class Storage{
    setItem(key,val){
        return localStorage.setItem(key,JSON.stringify(val))
    }
    getItem(key){
        let val=localStorage.getItem(key)?localStorage.getItem(key):null
        if(val){
            return JSON.parse(localStorage.getItem(key))
        }else{
            return val
        }
    }
    removeItem(key){
        localStorage.removeItem(key)
    }
    clear(){
        localStorage.clear()
    }
}
export const $Storage=new Storage()